﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>


<%
dim urls,RndTXT,tid

	randomize
	RndTXT=int((99999999)*rnd+1)

urls=Request.QueryString("urls")
if urls="" then urls="index.asp"


	dim rs,sql,i,id
		id=Request.QueryString("id")
		if not isnumeric(id) then id=0
		if id="" then id=0
		id=clng(id)


		if sid<>"Null" then
select case v
case "0"
we0="<br/>"
hr="------------<br/>"
title0="<card title=""回复信件"" ontimer="""&qingtian.backurl(urls)&"""><timer value='10'/><p align="""&qingtian.px&""">"
title1="<card title=""回复信件"" ontimer=""addinfo.asp?id="&id&"&amp;sid="&sidd&"""><timer value='10'/><p align="""&qingtian.px&""">"
title2="<card title=""回复信件""><p align="""&qingtian.px&""">"
title3="<card title=""回复信件"" ontimer="""&qingtian.backurl(urls)&"""><timer value='10'/><p align="""&qingtian.px&""">"
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
we2="</div>"
title0="<meta name=""keywords"" content="",V1.0""/><meta name=""author"" content=""晴天""/><meta http-equiv=""Cache-Control"" content=""max-age=0"" forua=""true""/><meta http-equiv=""Cache-Control"" content=""no-cache""/><meta http-equiv=""Expires"" content=""0""/><meta http-equiv=""Refresh"" content=""1; url="&qingtian.backurl(urls)&"""><title>回复信件</title></head><body>"
title1="<meta name=""keywords"" content="",V1.0""/><meta name=""author"" content=""晴天""/><meta http-equiv=""Cache-Control"" content=""max-age=0"" forua=""true""/><meta http-equiv=""Cache-Control"" content=""no-cache""/><meta http-equiv=""Expires"" content=""0""/><meta http-equiv=""Refresh"" content=""1; url=addinfo.asp?id="&id&"&amp;sid="&sidd&"""><title>回复信件</title></head><body>"
title2="<title>回复信件</title></head><body>"
title3="<meta name=""keywords"" content="",V1.0""/><meta name=""author"" content=""晴天""/><meta http-equiv=""Cache-Control"" content=""max-age=0"" forua=""true""/><meta http-equiv=""Cache-Control"" content=""no-cache""/><meta http-equiv=""Expires"" content=""0""/><meta http-equiv=""Refresh"" content=""1; url="&qingtian.backurl(urls)&"""><title>回复信件</title></head><body>"
End Select
		
		if Request.QueryString("Action")="save" then



			dim name,title
                        e=Request.QueryString("e")
			title=qingtian.repsql(trim(Request.form("content")))
			tid=Request("tid")
			if not isnumeric(tid) then tid=0
			if tid="" then tid=0
			tid=clng(tid)
                        name=left(title,30)&"....."
                face=Request.form("face")
		if not isnumeric(face) then face=0
		if face="" then face=0
		face=clng(face)
                if face<>0 then 
                title="[img]/img/"&face&".gif[/img]"+title
                name="[img]/img/"&face&".gif[/img]"+name
                end if
			if name<>"" and title<>"" and tid>0 then
if id=0 then
			%><%=title3%><%
else
%><%=title0%><%
end if
			qingtian.info
if tid=qingtian.nid then qingtian.err("不能向自己发送消息!")

			if Request("sead")="add" or Request("sead")="addsave"  then
			Set Rs = Server.CreateObject("Adodb.Recordset")
			Sql = "select  [name],[title],[ok],[isok],[system],[tid],[nid] from [qingtian_info]"
			Rs.Open Sql,conn,1,3
if qingtian.vip(qingtian.nid)="VIP会员" then
qingtian.delinfoo "0","100"
else
qingtian.delinfoo "0","40"
end if
			rs.addnew
			rs("name")=name
			rs("title")=title
			rs("tid")=tid
			rs("nid")=qingtian.nid
			rs("ok")=1
			rs("isok")=1
			rs("system")=0
			rs.update
			Rs.close
			set rs=nothing

			%><%=we%>信件发送成功!<%=we0%><%
			end if	
			if Request("sead")="save" or Request("sead")="addsave"  then
			Set Rs = Server.CreateObject("Adodb.Recordset")
			Sql = "select  [name],[title],[ok],[tid],[nid] from [qingtian_addinfo]"
			Rs.Open Sql,conn,1,3
			rs.addnew
			rs("name")=name
			rs("title")=title
			rs("tid")=tid
			rs("nid")=qingtian.nid
			rs("ok")=1
			rs.update
			Rs.close
			set rs=nothing
			%><%=we%>信件保存到发件箱成功!<%=we0%><%
			end if	
			if Request("sead")="draft"  then
			Set Rs = Server.CreateObject("Adodb.Recordset")
			Sql = "select  [name],[title],[ok],[isok],[system],[tid],[nid] from [qingtian_info]"
			Rs.Open Sql,conn,1,3
if qingtian.vip(qingtian.nid)="VIP会员" then
qingtian.delinfoo "0","100"
else
qingtian.delinfoo "0","40"
end if
			rs.addnew
			rs("name")=name
			rs("title")=title
			rs("tid")=tid
			rs("nid")=qingtian.nid
			rs("ok")=0
			rs("isok")=1
			rs("system")=0
			rs.update
			Rs.close
			set rs=nothing
			%><%=we%>信件保存到草稿箱成功!<%=we0%> <%
			end if
			else
	
				%><%=title1%><%
				qingtian.info
				if title="" then
				%><%=we%>信件内容不能为空!<%=we0%><%
				end if
				if tid<1 then
				%><%=we%>收信人ID不正确!<%=we0%><%
				end if
   				%><%=sou%><a href="addinfo.asp?sid=<%=sidd%>&amp;eid=<%=eid%>&amp;id=<%=id%>&amp;urls=<%=urls%>">返回修改</a><%=we0%><%
 
			end if
		else
			%><%=title2%>

			<%qingtian.info%>

		<%
			dim rep
		tid=Request.QueryString("bid")
		eid=Request.QueryString("eid")
                if eid=1 then
			Set Rs = Server.CreateObject("Adodb.Recordset")
			Sql = "select  [name],[nid],[title] from [qingtian_info] where id="&id&""
			Rs.Open Sql,conn,1,1
			if not (rs.bof and rs.eof) then
			rep="转发:" & rs("title")
                        if tid="" then
			tid=rs("nid")
                        else
                        tid=clng(tid) 
			end if
			end if
			Rs.close
			set rs=nothing
                 else
                 tid=clng(tid) 
                 rep=""
                 end if
%><%=qingtian.qingsav("91")%><%
		select case v
case "0"
%>
                <b>==发送新内线==</b><br/>
		收信ID或<a href="fans.asp?id=<%=id%>&amp;eid=<%=eid%>&amp;sid=<%=sidd%>&amp;urls=<%=urls%>">选择好友</a>:<br/><input emptyok="true"  type="text" maxlength="40" name="tid<%=RndTXT%>" value="<%=tid%>" format="*N" size="20"/><br/>
		发送内容:<br/><input emptyok="true"  type="text" name="content<%=RndTXT%>" value="<%=rep%>" size="20"/><br/>
<select name="sead" value="add">
<option value="add">发送</option>
<option value="draft">保存为草稿</option>
</select><br/>
		<anchor>提交
    		<go href="addinfo.asp?Action=save&amp;id=<%=id%>&amp;sid=<%=sidd%>&amp;urls=<%=urls%>" method='post'>
     	  	<postfield name="content" value="$(content<%=RndTXT%>)"/>
     	   	<postfield name="tid" value="$(tid<%=RndTXT%>)"/>
     	  	<postfield name="sead" value="$(sead)"/>
    		</go>
		</anchor>
<br/>
		<%
case "1"
		%>
                <%=dao%><b>==发送新内线==</b><%=we0%>
<form action="addinfo.asp?Action=save&amp;id=<%=id%>&amp;sid=<%=sidd%>&amp;urls=<%=urls%>" method="post">
<%=we%>收信ID或<a href="fans.asp?id=<%=id%>&amp;eid=<%=eid%>&amp;sid=<%=sidd%>&amp;urls=<%=urls%>">选择好友</a>:<br/>
<input emptyok="true"  type="text" maxlength="40" name="tid" value="<%=tid%>" format="*N" size="10"/><%=we0%>
<%=we%>发送内容:<%=we0%><%=sou%><textarea name="content" rows="4"/><%=rep%></textarea><br/>
<select name="sead" value="add">
<option value="add">发送</option>
<option value="draft">保存为草稿</option>
</select>
<input type="submit" value="提交"/><%=we0%>
</form>
		<%
End Select
		end if
if e=1 then 
Response.Redirect "/user/liaoinfo.asp?id="&tid&"&sid="&sidd&"&urls="&urls&""			
end if		 
%>
		<%=hr%><%=we%>
<a href="<%=qingtian.backurl(urls)%>">返回来源页</a>|<a href="fainfo.asp?sid=<%=sidd%>">发件箱</a><%=we0%><%=qingtian.qingsav("92")%>
<%

		else
Response.Redirect "/user/login.asp?sid="&sidd&"&url=addinfo.asp?sid="&sidd&"@@urls="&urls
		end if


end Function%>
